<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <main>
    <a style="color:red" href="http://www.hdcms.com">开源系统</a>
    <a style="color:red" href="http://houdunren.com">后盾人</a>
    <a href="http://www.yahu.com">雅虎</a>
  </main>
</body>
<script>
  const dommain=document.querySelector("main")
  let reg=/(<a.*href=['"])(http)(:\/\/)(www\.)?(hdcms|houdunren)/ig
  dommain.innerHTML=dommain.innerHTML.replace(reg,(v0,...args)=>{
     console.log(args);
     args[1]+="s"
     args[3]= args[3]||"www."
     return args.slice(0,5).join("")
  })
</script>
</html>